/*
 * CGlobalSensorTMTCStore.h
 *
 *  Created on: 21/07/2013
 *      Author: Santiago Carmona Meco
 */

#ifndef CGLOBALSENSORTMTCSTORE_H_
#define CGLOBALSENSORTMTCSTORE_H_


#include <public/PackMemManager.h>
#include <public/basic_types.h>
#include <public/ssi_link_layer.h>
#include <public/stdio.h>

class CGlobalSensorTMStore
{

		uint32_t freePackets;
		CPackHandler currentPack;
		CPackHandler deliveryPack;
		bool_t emptyPackList;

	public:
		CPackListHandler storePackList;

		void set_pack_pool_memory(PackPool * pPackPool,word16_t numOfPackets);
		void add_free_pack_list(CPackHandler &pack);
		bool_t get_free_pack_list(CPackHandler &pack);
		void get_tm_pack_list(CPackHandler &pack);
		bool_t get_force_tm_pack_list(CPackHandler &pack);
		void restore_tm_pack_list(CPackHandler &pack);
		uint8_t get_free_bytes_number();
		bool_t store_ssi_tm_frame(byte_t * pFrame);
		bool_t is_empty();

};

class CGlobalSensorTCStore
{

		uint8_t index;
		CPackHandler currentPack;
		uint16_t nPacks;
	public:
		CPackListHandler storePackList;

		void set_pack_pool_memory(PackPool * pPackPool,word16_t numOfPackets);
		void add_sgi_sen_tc_pack(CPackHandler  pack);
		bool_t get_ssi_data_frame(SSI_data_frame_t & dataFrame);

};


#endif /* CGLOBALSENSORTMTCSTORE_H_ */

